package mango.client;
import java.net.Socket;
import java.io.*;

public class MangoListener extends Thread {

    BufferedReader in = null;
    MangoClient parent;
    
    public MangoListener (BufferedReader input, MangoClient p) {
        super("MangoMultiServerThread");
        parent = p;
        in = input;
        this.start();
    }
    
    public void run () {
        String fromServer;
        try {
            while ((fromServer = in.readLine()) != "<$> Disconnect Signal" && fromServer != null) {
                System.out.println(fromServer);
            }
            System.out.println("<!> Session terminated by host.");
            parent.quit();
        }
        catch (Exception e) {}
    }

}
